package com.apps.express.Express100.model.po;

import com.apps.express.Express100.enums.ExpressStatus;
import com.apps.sannotation.constraints.NoNull;
import com.apps.saspect.ValidMethod;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * 快递明细模型
 */
@ApiModel("订单的快递明细模型")
@Data
public class ExpressItem {

   @ApiModelProperty("明细内容")
   private String content="";
   @ApiModelProperty("状态编码")
   private Integer status;
   @ApiModelProperty("状态的中文名称")
   private String status_name;
   @ApiModelProperty("时间")
   @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm")
   private LocalDateTime gmt_create;

    @ValidMethod
    public void setContent(@NoNull String content) {
        this.content = content;
    }
    @ValidMethod
    public void setStatus(@NoNull Integer status) {
        this.status = status;
        this.status_name= ExpressStatus.getCodeByKudi100(status).getKuaidi100();
    }
    @ValidMethod
    public void setGmt_create(@NoNull LocalDateTime gmt_create) {
        this.gmt_create = gmt_create;
    }
}
